#include "LightEntity.h"
#include "EnvMapSample.h"
#include "PlayerStart.h"

namespace FinalRendering
{
	namespace Plugin
	{
		HANDLE module;
		IEngine * engine;

		void GX_API_ENTRY EntityPlugin_Init(bool isEditor, IEngine * _engine, HMODULE _module)
		{
			engine = _engine;
			module = _module;
			Light::InitPlugin(isEditor, engine, (HMODULE)module);
			EnvMapSample::InitPlugin(isEditor, engine, (HMODULE)module);
			PlayerStart::InitPlugin(isEditor, engine, (HMODULE)module);
		}

		void GX_API_ENTRY EntityPlugin_Destroy()
		{
			Light::DestroyPlugin();
			EnvMapSample::DestroyPlugin();
		}

		int GX_API_ENTRY EntityPlugin_GetClassesCount()
		{
			return 3;
		}

		IEntityDesc * GX_API_ENTRY EntityPlugin_GetEntityDesc(int id)
		{
			switch (id)
			{
			case 0:
				return LightDesc::GetDesc();
			case 1:
				return EnvMapSampleDesc::GetDesc();
			case 2:
				return PlayerStartDesc::GetDesc();
			default:
				return 0;
			}
		}

	}
}